<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../../js库/mock.js"></script>
    <script src="../../js库/vue.js"></script>
    <title>css三角</title>
    <style>
        * {
            margin: 0;padding: 0;
        }
        /*
        如果没有高度和宽度只有边框 则边框会平分
        */
        .box {
          width: 50px;
          height: 50px;
          background-color: green;
            margin: 100px  auto;
            position: relative;
            top: 0;
            left: 0;

        }
        .sanjiao {
            /* width: 10px;
            height: 10px; */
           width: 0;
           height: 0;
            border: 5px solid transparent;
            border-bottom-color: green;
            position: absolute;
            top: -10px;
            left: 50%;
            margin-left: -5px;
        }
    </style>
</head>

<body>
    <div id="root">
        <div class="box">
            <div class="sanjiao"></div>
        </div>
    </div>
</body>
<script>
    new Vue({
        el: '#root',
        data() {
            return {
            }
        },
    })
</script>

</html>